home *** CD-ROM | disk | FTP | other *** search
- on ProcAddWagon
- global ListNum, givenList, randomized, wagonList, exitReward, NewCity, loc1Rew, Loc2Rew, Loc1Name, Loc2Name, curLoc
- setAt(givenList, ListNum, 1)
- if randomized = 0 then
- set tot to 0
- repeat with T = 1 to count(givenList)
- if getAt(givenList, T) = 1 then
- set tot to tot + 1
- end if
- end repeat
- if tot = 1 then
- set Loc1Name to getAt(NewCity, ListNum)
- set loc1Rew to exitReward
- else
- if tot = 2 then
- set Loc2Name to getAt(NewCity, ListNum)
- set Loc2Rew to exitReward
- end if
- end if
- if tot >= 2 then
- set randomized to 1
- RandomizeAfterTwo()
- end if
- end if
- set temp to count(wagonList)
- set temp to temp + 1
- setAt(wagonList, temp, exitReward)
- if randomized then
- set tempNum to getOne(NewCity, curLoc)
- setAt(rewardLocs, tempNum, EMPTY)
- end if
- end
-